<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理中心</title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jquery.colorbox.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jQselect.js"></script>
<link href="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/colorbox2.css" rel="stylesheet" type="text/css"/>
</head>

<body>
    <div id="main">
        <div id="navigation">当前位置：<a href="<?php echo $this->projectUrl(array('controller'=>'partner', 'action'=>'index'));?>">商家列表 </a> &gt; <span id="focus">产品列表</span>
        </div>
        <div id="body">
            <div id="search">
                <form id="searchForm" name="searchForm" method="post" action="<?php echo $this->projectUrl(array('controller'=>'partner-product'));?>">
                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                            	商家：
                                <select name="partnerCode">
                                    <option value=""> ---请选择--- </option>
                                    <?php foreach ($this->partnerRow as $k=>$v) {
                                    	echo "<option value=\"{$v['code']}\" ";
                                    	if ($v['code'] == $this->vars['partnerCode']) {
                                    		echo 'selected="selected" ';
                                    	}
                                    	echo ">{$v['name']}";
                                    	echo "</option>";
                                    }?>
                                </select>
                                &nbsp;
                                产品编号：
                                <input type="text" id="code" name="code" value="<?php echo $this->vars['code']; ?>" class="input">
                                &nbsp;
                                 产品名称：
                                <input type="text" id="name" name="name" value="<?php echo $this->vars['name']; ?>" class="input">
                                &nbsp;
                                <input type="submit" name="button" id="button" value="查找" class="button" />
                                
                                  <div id="topOtherMenu">
                                  <input type="button" name="changeMailBtn" id="changeMailBtn" value="批量修改日报邮箱" class="button" onclick="location.href='<?php echo $this->projectUrl(array('action'=>'change-mail'));?>';" />
                                   </div>
                             </td>
                        </tr>
                    </table>
                </form>
            </div>
            <div id="content">
                <form id="listForm" name="listForm" method="post" action="<?php echo $this->projectUrl(array('controller'=>'partner-product', 'action'=>'delete', 'backUrl'=>urlencode($this->pageUrl)));?>">
                    <table class="table">
                        <tr class="subject">
                            <td width="5%" class="checkBoxTd">选择</td>
                            <td>商家名称</td>
                            <td>商家编号</td>
                            <td>产品编号</td>
                            <td>产品名称</td>
                            <td width="10%" class="checkBoxTd">操作</td>
                        </tr>
<?php 
foreach ( $this->rows as $row){
?>
                        <tr class="dataLine">
                            <td width="5%" class="checkBoxTd"><input type="checkbox" name="selectId[]" id="select0" class="selectCheckBox" value="<?php echo $row['id'];?>" /></td>
                            <td><?php echo $row['partnerName'];?></td>
                            <td><?php echo $row['partnerCode'];?></td>
                            <td><?php echo $row['code'];?></td>
                            <td><?php echo $row['name'];?></td>
                            <td width="10%" class="checkBoxTd">
                                <a href="<?php echo $this->projectUrl(array('controller'=>'product-platform', 'action'=>'list', 'productCode'=>$row['code'], 'backUrl'=>urlencode($this->pageUrl)));?>">平台</a>
                                <a href="<?php echo $this->projectUrl(array('controller'=>'partner-product', 'action'=>'update', 'partnerCode'=>$row['partnerCode'], 'id'=>$row['id'], 'backUrl'=>urlencode($this->pageUrl)));?>">编辑</a>							</td>
                        </tr>
<?php }?>
                    </table>
                    <table class="controlTable">
                        <tr>
                            <td align="left">
                                <input type="button" name="all" id="all" value="全选" class="button" onclick="$('.selectCheckBox').attr('checked', true);"/>
                                <input type="button" name="cancel" id="cancel" value="取消" class="button" onclick="$('.selectCheckBox').attr('checked', false);"/>
                                <input type="button" name="delete" id="delete" value="删除选中" class="button" onclick="return del();"/>
                            </td>
                             <td align="right" class="paginator" colspan="6">
                             	<?php echo $this->pageString;?>
                             </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
</div>
<script language="javascript">
function del()
{
    if (confirm('确定删除吗？')) {
        $("#listForm").attr('action', '<?php echo $this->projectUrl(array('controller'=>'partner-product', 'action'=>'delete', 'backUrl'=>urlencode($this->pageUrl)));?>');
        $("#listForm").submit();
        return true;
    } else {
        return false;
    }
}
</script>
</body>
</html>